package com.michaelbulava.TFS.actions;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.michaelbulava.TFS.ui.wizards.share.ShareWizard;

/**
 * Created by mbulava on 6/23/2015.
 */
public class ImportToTFSAction extends AnAction implements DumbAware {

    @Override
    public void actionPerformed(AnActionEvent e) {
        Project project = e.getData(CommonDataKeys.PROJECT);
        if (project == null)
            project = ProjectManager.getInstance().getDefaultProject();


        ShareWizard shareWizard = new ShareWizard(project);
        if(shareWizard.showAndGet())
            shareWizard.performShare();
    }

}
